window.onload = function () {
	getTime();
	setInterval(getTime,1000);
}

function toDouble(num) {
	if(num < 10) {
		return "0" + num;
	} else {
		return "" + num;
	}
}

function getTime() {
	var aSpan = document.getElementsByTagName("span");

	var oDate = new Date();

	var formal = oDate.getFullYear() + "" + toDouble(oDate.getMonth() + 1) + toDouble(oDate.getDate()) + toDouble(oDate.getHours()) + toDouble(oDate.getMinutes()) + toDouble(oDate.getSeconds());

	for (var i = 0; i < aSpan.length; i++) {
		aSpan[i].innerHTML = formal[i];
	}
}